package cn.kgc.cloud.controller;

import cn.kgc.cloud.service.SentinelService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 课工场
 * @date 2024/1/10
 * @description
 */
@RestController
@RequestMapping("sentinel")
public class SentinelController {

    @Resource
    private SentinelService sentinelService;

    @GetMapping("m1")
    public String method1(){
        String s = sentinelService.method3();
        return "invoke SentinelController  method1 ok"+s;
    }

    @GetMapping("m2")
    public String method2(){
        String s = sentinelService.method3();
        return "invoke SentinelController  method2 ok"+s;
    }

    @GetMapping("m3")
    public String method3(Integer id){
        if(id<0){
            throw  new RuntimeException("请求参数异常");
        }
        return "invoke SentinelController  method3 ok";
    }


}
